/*****************************************************************************
 * Open MCT, Copyright (c) 2014-2018, United States Government
 * as represented by the Administrator of the National Aeronautics and Space
 * Administration. All rights reserved.
 *
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 * Open MCT includes source code licensed under additional open source
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 * this source code distribution or the Licensing information page available
 * at runtime from the About dialog for additional information.
 *****************************************************************************/
.t-edit-handle-holder { display: none; }

.l-grid-holder {
    display: none;
    @extend .abs;
    pointer-events: none;
    z-index: 0;
    .l-grid {
        @extend .abs;
        &.l-grid-y { background-position: 0 1px; }
    }
}

.s-status-editing {
    $handleD: 5px;
    .t-edit-handle-holder { display: block; }
    .edit-corner,
    .edit-handle {
        position: absolute;
        z-index: 2;
    }

    .edit-corner {
        background: rgba($colorSelectableSelectedPrimary, 0.5);
        cursor: crosshair;
        display: none; // Hide by default
        border: 1px solid $colorSelectableSelectedPrimary;
        width: $handleD;
        height: $handleD;
        $o: (-1 * $handleD) + 1px;
        &:hover {
            z-index: 11;
        }
        &.edit-resize-nw { top: $o; left: $o; }
        &.edit-resize-ne { top: $o; right: $o; }
        &.edit-resize-se { bottom: $o; right: $o; }
        &.edit-resize-sw { bottom: $o; left: $o; }
    }

    .edit-handle.edit-move {
        // main move box for the whole frame element
        $m: 0;
        left: $m;
        right: $m;
        top: $m;
        bottom: $m;
        z-index: 1;
    }

    .frame.child-frame.panel {
        &:hover {
            .view-switcher {
                opacity: 1;
            }
        }
    }

    // Editing Grids
    .l-grid-holder {
        .l-grid {
            &.l-grid-x { @include bgTicks($colorGridLines, 'x'); }
            &.l-grid-y { @include bgTicks($colorGridLines, 'y'); }
        }
    }

    // Display grid when selected or selection parent.
    .s-selected .l-grid-holder,
    .s-selected-parent .l-grid-holder {
        display: block;
    }

    // Display in nested frames...
    .t-frame-outer {
        // ...when drilled in or selection parent...
        &.s-drilled-in, &.s-selected-parent {
            .l-grid-holder {
                display: block;
            }
            .t-frame-outer:not(.s-drilled-in) .l-grid-holder {
                display: none;
            }
        }
        // ...but hide otherwise.
        .l-grid-holder {
            display: none;
        }
    }
}
